package cn.gson.crm.model.pojos;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;
@Table(name = "FUNCTIONSGNS")
@Entity
public class Functions {
    private Integer fstId;
    private String fstName;
    private List<Function> function;

    @OneToMany(mappedBy = "functionsList")
    public List<Function> getFunction() {
        return function;
    }

    public void setFunction(List<Function> function) {
        this.function = function;
    }

    @Id
    @Column(name = "FST_ID", nullable = false, precision = 0)
    public Integer getFstId() {
        return fstId;
    }

    public void setFstId(Integer fstId) {
        this.fstId = fstId;
    }

    @Basic
    @Column(name = "FST_NAME", nullable = true, length = 255)
    public String getFstName() {
        return fstName;
    }

    public void setFstName(String fstName) {
        this.fstName = fstName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Functions functions = (Functions) o;
        return fstId == functions.fstId &&
                Objects.equals(fstName, functions.fstName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(fstId, fstName);
    }
}
